<script type="text/javascript">
    activateMenuContract();
    activateSubMenuView();

    {% if error_msg %}
    displayError({{ error_msg }})
    {% endif %}
</script>

<div id="contract">
    <div class="label">Name</div>
    <div class="value">
        <select id="contractSelect" name="contract">
            {% for contract_name,id in availableContracts.items %}
                {% if id == selected_contract %}
                    <option value="{{ id }}" selected="selected">{{ contract_name }}</option>
                {% else %}
                    <option value="{{ id }}">{{ contract_name }}</option>
                {% endif %}
            {% endfor %}
        </select>
    </div>
    <div class="label">Start on</div>
    <div class="value">
        <input id="contract-start" type="text" name="start" size="20" value="{{ start }}"/>
    </div>

    <div class="label">Stop on</div>
    <div class="value">
        <input id="contract-stop" type="text" name="stop" size="20" value="{{ end }}"/>
    </div>

    <div class="label">Client Name</div>
    <input id="client-name" class="client-name" value="{{ client_name }}"/>

    <div class="label">End Customer</div>
    <input id="customer-name" class="customer-name" value="{{ customer_name }}"/>


    <div class="label">Hourly Rate</div>
    <div class="value">
        <input id="rate" type="text" name="rate" value="{{ rate }}"/>
    </div>
</div>

<script type="text/javascript">
    $("#contractSelect").change(function() {
        changeContent("/contract/view/" + $("select option:selected").val() + "/");
    });
</script>